package test2;

public class PhoneTest {
    public static void main(String[] args) {
        Phone arr[]= new Phone[3];

        Phone arr1=new Phone("IQOO",1000,"绿色");
        Phone arr2=new Phone("小米",1999,"白色");
        Phone arr3=new Phone("honour",2900,"黄色");
        arr[0]=arr1;
        arr[1]=arr2;
        arr[2]=arr3;
        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum+arr[i].getPrice();
        }

        int avg=sum/arr.length;
        System.out.println(avg);
    }
}
